#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.biz.pay.alipay;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by well on 15/3/12.
 */
public class AlipayApi {



    public static String renderAlipayForm(String orderNo, long fee, AlipayConfig alipayConfig, String ip,String showUrl,String notifyUrl,String returnUrl,String subject) {
        String payment_type = "1";

        String seller_email = alipayConfig.getSellerEmail();
        String out_trade_no = orderNo;
       // String subject = "(" + orderId + ")";
        String total_fee = String.valueOf(fee/100.00);
        String body = "(" + orderNo + ")";

        String anti_phishing_key = "";

        Map param = new HashMap();
        param.put("service", "create_direct_pay_by_user");
        param.put("partner", alipayConfig.getPartner());
        param.put("_input_charset", "utf-8");
        param.put("payment_type", payment_type);
        param.put("notify_url", notifyUrl);
        param.put("return_url", returnUrl);
        param.put("seller_email", seller_email);
        param.put("out_trade_no", out_trade_no);
        param.put("subject", subject);
        param.put("total_fee", total_fee);
        param.put("subject", subject);
        param.put("body", body);
        param.put("show_url", showUrl);
        param.put("anti_phishing_key", anti_phishing_key);
        param.put("exter_invoke_ip", ip);
        String html = AlipayHelper.buildRequest(param, alipayConfig.getSellerKey(), "get", "确认");
        return html;
    }



}
